package com.dailyblue.java.project.smbms.stock.handler;

import com.dailyblue.java.commons.util.JsonResult;
import com.dailyblue.java.commons.util.ResultTool;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class StockExceptionHandler {

    public static JsonResult update(int bid, int num, Throwable e) {
        log.info("更新'{}'编号商品失败，库存不足！", bid);
        log.info("异常信息是:{}", e.getMessage());
        return ResultTool.fail("更新'" + bid + "'编号商品失败，库存不足！");
    }
}
